package com.ruoyi.coffee.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.coffee.mapper.OrderItemsMapper;
import com.ruoyi.coffee.domain.OrderItems;
import com.ruoyi.coffee.service.IOrderItemsService;
import javax.annotation.Resource;
/**
 * 订单详情Service业务层处理
 * 
 * @author dxj
 * @date 2025-01-08
 */
@Service
public class OrderItemsServiceImpl  extends ServiceImpl<OrderItemsMapper, OrderItems> implements IOrderItemsService
{
    @Resource
    private OrderItemsMapper orderItemsMapper;

    /**
     * 查询订单详情
     * 
     * @param id 订单详情主键
     * @return 订单详情
     */
    @Override
    public OrderItems selectOrderItemsById(Long id)
    {
        return orderItemsMapper.selectOrderItemsById(id);
    }

    /**
     * 查询订单详情列表
     * 
     * @param orderItems 订单详情
     * @return 订单详情
     */
    @Override
    public List<OrderItems> selectOrderItemsList(OrderItems orderItems)
    {
        return orderItemsMapper.selectOrderItemsList(orderItems);
    }

    /**
     * 新增订单详情
     * 
     * @param orderItems 订单详情
     * @return 结果
     */
    @Override
    public int insertOrderItems(OrderItems orderItems)
    {
        orderItems.setCreateTime(DateUtils.getNowDate());
        return orderItemsMapper.insertOrderItems(orderItems);
    }

    /**
     * 修改订单详情
     * 
     * @param orderItems 订单详情
     * @return 结果
     */
    @Override
    public int updateOrderItems(OrderItems orderItems)
    {
        orderItems.setUpdateTime(DateUtils.getNowDate());
        return orderItemsMapper.updateOrderItems(orderItems);
    }

    /**
     * 批量删除订单详情
     * 
     * @param ids 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsByIds(Long[] ids)
    {
        return orderItemsMapper.deleteOrderItemsByIds(ids);
    }

    /**
     * 删除订单详情信息
     * 
     * @param id 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsById(Long id)
    {
        return orderItemsMapper.deleteOrderItemsById(id);
    }
}
